
{% macro field(row, lname, label) %}
    <tr>
        <td class="label">
            <label id="l{{ lname }}" for="{{ lname }}">{{ label }}:</label>
        </td>
        <td class="field">
            {{ form_widget(row) }}
        </td>
        <td class="status"></td>
        <td>
            {{ form_errors(row) }}
        </td>
    </tr>
{% endmacro %}

{% block content %}

<link rel="stylesheet" type="text/css" media="screen" href="{{ asset('bundles/billing/css/validate.css') }}" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js" type="text/javascript"></script>
<script src="{{ asset('bundles/billing/js/jquery.validate.js') }}" type="text/javascript"></script>
<script src="{{ asset('bundles/billing/js/validate_user.js') }}" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function()
    {
        $('#submit_button').click(function()
        {
            $('#content').html('создание пользователя <img alt="загрузка" src="{{ asset('bundles/billing/i/load.gif') }}">');
            $(#add_form).submit();
            return false;
        });
    });
</script>
<h4>Регистрация:</h4>

<div id="add_box">
  <div id="add_wrap">
    <form id="add_form" method="post" action="#">
        <table>
           {{ _self.field(form.login, 'login', 'E-mail (в качестве логина)') }}
           {{ _self.field(form.password, 'password', 'Пароль') }}
           {{ _self.field(form.password_confirm, 'password_confirm', 'Пароль второй раз') }}
           {{ form_widget(form._token) }}
        <tr>
            <td>
            <div class="field">
                <input id="submit_button" name="add_order" type="submit" value="Создать"/>
                <div id="content>
                </div>
            </div>
            </td>
        </tr>
        </table>
    </form>
   </div>
</div>


{% endblock %}
